package com.helloniu.fl.util {

public class Class2
{
    public static function addClass(cname:String, cls:Class):void {
        map[cname] = new Class2(cname, cls);
    }

    public static function forName(cname:String):Class2 {
        var obj:Class2 = map[cname] as Class2;

        return obj;
    }

    public function Class2(cname:String, cls:Class) {
        super();

        this.cname = cname;
        this.clazz = cls;
    }

    public function newInstance():Object {
        return new clazz();
    }

    public function get name():String {
        return cname;
    }

    public function toString():String {
        return "class[" + cname + "]";
    }

    private static var map:Array = new Array();

    private var cname:String;
    private var clazz:Class;
}
}

